//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类;

public class demo_2176 {
    public demo_2176() {
    }

    public int countPairs(int[] nums, int k) {
        int n = nums.length;
        int count = 0;

        for(int i = 0; i < n; ++i) {
            for(int j = i + 1; j < n; ++j) {
                if (nums[i] == nums[j] && i * j % k == 0) {
                    ++count;
                }
            }
        }

        return count;
    }
}
